<!-- 
 *  Copyright [2014] UW-Parkside
 * Authors: Jasmine Griffiths, Matthew Zygowicz, Armando Narvaez
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
*/
-->
<!-- 'hiddenRouteBox.php' is the sticky window when the user is adding a new route using the box -->
<!-- Fields are:  ID, Route, Location, Day, Time, and Direction      -->
  <?php
            print "<form id='addRouteForm' action='/index.php/kat/addroute' method='POST'>";
            ?>
            <p><strong>Add Stop for New Route</strong></p>
            <hr />

            <?php
            if (!isset($_SESSION['mode'])) { //Check if route has been entered
                print "<p>";
                print "<label class='field' for='route'>Route</label>";
                print "<input class='reducedInput' name='routenumber' type='text' placeholder='' required=''>";
                print "</p>";
            } 
            else{//Hide route field when user entered route number
                print "<p class = 'hidden'>";
                print "<label hidden for='route'>Route</label>";
                print "<input hidden name='routenumber' type='text' value = '$_POST[routenumber]'>";
                print "</p>";
            }
            ?>
			
			<!-- ------------Location field----------------------- -->
            <p>
                <label class="field" for="location">Location</label>
                <input id = "location" class="reducedInput" name="location" type="text" required="">

            </p>
			<!-- ------------End Location field------------------- -->
			
			<!-- -------------Day field---------------------------- -->
            <p>
				<label class="field" for="day">Day</label>
				<select class = "reducedInput" name="day">
					<option value="Weekend">Weekend</option><!-- Weekend option -->
					<option value="Weekday">Weekday</option><!-- Weekday option -->
				</select>
				<!--<input class="reducedInput" name="day" type="text" placeholder="" required=""> -->
			</p>
			<!-- -------------End Day field------------------------ -->
			
			<!-- -------------Time field--------------------------- -->
            <p>
                <label class="field" for="time">Time</label><!-- Time Field, Currently inputting as 24-hour as of May 7, 2014 -->
                <select id='hourSelect' class='reducedInputTime' name='hour'>
		    <?php
		    for($i=1; $i < 13 ; $i++){
			      print "<option value='$i'>$i</option>";
		    }
		?>
		</select>
		<select id='minuteSelect' class='reducedInputTime' name='minute'>
		<?php
		    for($i=0; $i < 60 ; $i++){
			      if($i < 10)
					print "<option value='$i'>0$i</option>";
			      else
					print "<option value='$i'>$i</option>";
		    }
		?>
		</select>
		<select id='ampmSelect' class='reducedInputTime' name='ampm'>
		    <option value='am'>AM</option>
		    <option value='pm'>PM</option>
		</select>
	    </p>
            <!-- -------------End Time field----------------------- -->

			<!-- -------------ID field----------------------------- -->
            <p class="hidden">
                <label hidden for="id">ID</label>
                <input id='id' name="id" type="text" placeholder="" hidden >
            </p>
			<!-- -------------End ID field----------------------------- -->
			
			<!-- -------------Direction field-------------------------- -->
           <p>
		    <label class="field" for="direction">Direction</label>
		    <select id='direction' name="direction">
				  <option value="North">North</option><!-- North option -->
				  <option value="South">South</option><!-- South option -->
				  <option value="East">East</option><!-- East option -->
				  <option value="West">West</option><!-- West option -->
		    </select>
            </p>
            <!-- -------------End Direction field---------------------- -->
			
			<!-- ------------------Buttons----------------------------- -->
            <?php 
                if (isset($_SESSION['mode'])){ //Check if in 'editmode', create add/delete buttons
                   print "<input id='submit' class='reducedSize right yellow button' value='Add Stop' name='submit' type='submit'>";
                   print "<input class='reducedSize right yellow button' value='Delete Stop' name='submit' type='submit'>"; 
                }
                else{//Else, show only one button which is an "add route" button
                  print  "<input class='reducedSize right yellow button' value='Add Route' name='submit' type='submit' onclick = \"removeField()\">";
                }
            ?>

            <input class="reducedSize right blue button" value="Reset/Clear Form" name="reset" type="reset" onclick="resetAddRouteForm()"><!-- Reset Button -->
			<!-- -----------------End Buttons-------------------------- -->
            </form>
